package cn.yuanqiao.archive.Identify.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * minganci对象 BJYQ_MINGANCIKU
 * 
 * @author 赵常飞
 * @date 2023-07-23
 */
public class TenantMinganciku extends BaseEntity
{
    private final String BIGTABLENAME = "_MINGANCIKU";

    public TenantMinganciku() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("TenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    private static final long serialVersionUID = 1L;
    private String tableName;

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    /** 主键id */
    @IdAnnotation
    private Long id;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 备注 */
    @Excel(name = "备注")
    private String beizhu;

    /** 状态 */
    @Excel(name = "状态", readConverterExp = "0=启用,1=冻结",combo="启用,冻结")
    private Integer state;

    /** 创建人id */
    private Long creatorId;

    /** 是否删除 */
    @Excel(name = "是否删除", readConverterExp = "0=未删除,1=删除",combo="未删除,删除")
    private Integer isDel;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setBeizhu(String beizhu)
    {
        this.beizhu = beizhu;
    }
    public String getBeizhu()
    {
        return beizhu;
    }
    public void setState(Integer state) 
    {
        this.state = state;
    }

    public Integer getState() 
    {
        return state;
    }
    public void setCreatorId(Long creatorId) 
    {
        this.creatorId = creatorId;
    }

    public Long getCreatorId() 
    {
        return creatorId;
    }
    public void setIsDel(Integer isDel) 
    {
        this.isDel = isDel;
    }

    public Integer getIsDel() 
    {
        return isDel;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("beizhu", getBeizhu())
            .append("state", getState())
            .append("createTime", getCreateTime())
            .append("creatorId", getCreatorId())
            .append("updateTime", getUpdateTime())
            .append("isDel", getIsDel())
            .toString();
    }
}
